

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>7.3. Atom selection Hierarchy — MDAnalysis.core.Selection &mdash; MDAnalysis v0.7.5-devel documentation</title>
    <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '0.7.5-devel',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within MDAnalysis v0.7.5-devel documentation"
          href="../../_static/opensearch.xml"/>
    <link rel="shortcut icon" href="../../_static/mdanalysis-logo.ico"/>
    <link rel="top" title="MDAnalysis v0.7.5-devel documentation" href="../../index.html" />
    <link rel="up" title="7. Core modules" href="../core_modules.html" />
    <link rel="next" title="7.4. Compute observable timeseries from trajectories — MDAnalysis.core.Timeseries" href="Timeseries.html" />
    <link rel="prev" title="7.2. Fundamental building blocks — MDAnalysis.core.AtomGroup" href="AtomGroup.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="Timeseries.html" title="7.4. Compute observable timeseries from trajectories — MDAnalysis.core.Timeseries"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="AtomGroup.html" title="7.2. Fundamental building blocks — MDAnalysis.core.AtomGroup"
             accesskey="P">previous</a> |</li>
        <li><a href="../../index.html">MDAnalysis v0.7.5-devel documentation</a> &raquo;</li>
          <li><a href="../core_modules.html" accesskey="U">7. Core modules</a> &raquo;</li> 
      </ul>
    </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/mdanalysis-logo-200x150.png" alt="Logo"/>
            </a></p>
  <h4>Previous topic</h4>
  <p class="topless"><a href="AtomGroup.html"
                        title="previous chapter">7.2. Fundamental building blocks &#8212; <tt class="docutils literal docutils literal"><span class="pre">MDAnalysis.core.AtomGroup</span></tt></a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="Timeseries.html"
                        title="next chapter">7.4. Compute observable timeseries from trajectories &#8212; <tt class="docutils literal"><span class="pre">MDAnalysis.core.Timeseries</span></tt></a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/documentation_pages/core/Selection.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <span class="target" id="module-MDAnalysis.core.Selection"></span><div class="section" id="atom-selection-hierarchy-mdanalysis-core-selection">
<h1>7.3. Atom selection Hierarchy &#8212; <a class="reference internal" href="#module-MDAnalysis.core.Selection" title="MDAnalysis.core.Selection"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.core.Selection</span></tt></a><a class="headerlink" href="#atom-selection-hierarchy-mdanalysis-core-selection" title="Permalink to this headline">¶</a></h1>
<p>These objects are constructed and applied to the group</p>
<p>Currently all atom arrays are handled internally as sets, but returned as AtomGroups</p>
<dl class="class">
<dt id="MDAnalysis.core.Selection.BackboneSelection">
<em class="property">class </em><tt class="descclassname">MDAnalysis.core.Selection.</tt><tt class="descname">BackboneSelection</tt><a class="headerlink" href="#MDAnalysis.core.Selection.BackboneSelection" title="Permalink to this definition">¶</a></dt>
<dd><p>A BackboneSelection contains all atoms with name &#8216;N&#8217;, &#8216;CA&#8217;, &#8216;C&#8217;, &#8216;O&#8217;.</p>
<p>This excludes OT* on C-termini (which are included by, eg VMD&#8217;s backbone selection).</p>
</dd></dl>

<dl class="class">
<dt id="MDAnalysis.core.Selection.BaseSelection">
<em class="property">class </em><tt class="descclassname">MDAnalysis.core.Selection.</tt><tt class="descname">BaseSelection</tt><a class="headerlink" href="#MDAnalysis.core.Selection.BaseSelection" title="Permalink to this definition">¶</a></dt>
<dd><p>Selection of atoms in nucleobases.</p>
<p>Recognized atom names (from CHARMM):</p>
<blockquote>
<div>&#8216;N9&#8217;, &#8216;N7&#8217;, &#8216;C8&#8217;, &#8216;C5&#8217;, &#8216;C4&#8217;, &#8216;N3&#8217;, &#8216;C2&#8217;, &#8216;N1&#8217;, &#8216;C6&#8217;,
&#8216;O6&#8217;,&#8217;N2&#8217;,&#8217;N6&#8217;, &#8216;O2&#8217;,&#8217;N4&#8217;,&#8217;O4&#8217;,&#8217;C5M&#8217;</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="MDAnalysis.core.Selection.CASelection">
<em class="property">class </em><tt class="descclassname">MDAnalysis.core.Selection.</tt><tt class="descname">CASelection</tt><a class="headerlink" href="#MDAnalysis.core.Selection.CASelection" title="Permalink to this definition">¶</a></dt>
<dd><p>Select atoms named CA in protein residues (supposed to be the C-alphas)</p>
</dd></dl>

<dl class="class">
<dt id="MDAnalysis.core.Selection.NucleicBackboneSelection">
<em class="property">class </em><tt class="descclassname">MDAnalysis.core.Selection.</tt><tt class="descname">NucleicBackboneSelection</tt><a class="headerlink" href="#MDAnalysis.core.Selection.NucleicBackboneSelection" title="Permalink to this definition">¶</a></dt>
<dd><p>A NucleicBackboneSelection contains all atoms with name &#8220;P&#8221;, &#8220;C5&#8217;&#8221;, C3&#8217;&#8221;, &#8220;O3&#8217;&#8221;, &#8220;O5&#8217;&#8221;.</p>
</dd></dl>

<dl class="class">
<dt id="MDAnalysis.core.Selection.NucleicSelection">
<em class="property">class </em><tt class="descclassname">MDAnalysis.core.Selection.</tt><tt class="descname">NucleicSelection</tt><a class="headerlink" href="#MDAnalysis.core.Selection.NucleicSelection" title="Permalink to this definition">¶</a></dt>
<dd><p>A nucleic selection consists of all atoms in nucleic acid residues with  recognized residue names.</p>
<p>Recognized residue names:</p>
<ul>
<li><dl class="first docutils">
<dt>from the Charmm force field ::</dt>
<dd><p class="first last">awk &#8216;/RESI/ {printf &#8220;&#8217;&#8221;&#8217;&#8221;%s&#8221;&#8217;&#8221;&#8217;,&#8221;,$2 }&#8217; top_all27_prot_na.rtf</p>
</dd>
</dl>
</li>
<li><p class="first">recognized: &#8216;ADE&#8217;, &#8216;URA&#8217;, &#8216;CYT&#8217;, &#8216;GUA&#8217;, &#8216;THY&#8217;</p>
</li>
</ul>
</dd></dl>

<dl class="class">
<dt id="MDAnalysis.core.Selection.NucleicSugarSelection">
<em class="property">class </em><tt class="descclassname">MDAnalysis.core.Selection.</tt><tt class="descname">NucleicSugarSelection</tt><a class="headerlink" href="#MDAnalysis.core.Selection.NucleicSugarSelection" title="Permalink to this definition">¶</a></dt>
<dd><p>A NucleicSugarSelection contains all atoms with name &#8216;C1&#8217;&#8216;, &#8216;C2&#8217;&#8216;,&#8217;C3&#8217;&#8216;, &#8216;C4&#8217;&#8216;, &#8216;O2&#8217;&#8216;,&#8217;O4&#8217;&#8216;,&#8217;O3&#8217;&#8216;.</p>
</dd></dl>

<dl class="class">
<dt id="MDAnalysis.core.Selection.NucleicXstalSelection">
<em class="property">class </em><tt class="descclassname">MDAnalysis.core.Selection.</tt><tt class="descname">NucleicXstalSelection</tt><a class="headerlink" href="#MDAnalysis.core.Selection.NucleicXstalSelection" title="Permalink to this definition">¶</a></dt>
<dd><p>A nucleic selection consists of all atoms in nucleic acid residues with PDB-like resnames.</p>
<p>Recognized residue names:</p>
<ul>
<li><dl class="first docutils">
<dt>from the Charmm force field::</dt>
<dd><p class="first last">awk &#8216;/RESI/ {printf &#8220;&#8217;&#8221;&#8217;&#8221;%s&#8221;&#8217;&#8221;&#8217;,&#8221;,$2 }&#8217; top_all27_prot_na.rtf</p>
</dd>
</dl>
</li>
<li><p class="first">recognized: &#8216;A&#8217;, &#8216;U&#8217;, &#8216;C&#8217;, &#8216;G&#8217;, &#8216;DT&#8217;,&#8217;DA&#8217;,&#8217;DC&#8217;,&#8217;DG&#8217;</p>
</li>
</ul>
</dd></dl>

<dl class="class">
<dt id="MDAnalysis.core.Selection.PropertySelection">
<em class="property">class </em><tt class="descclassname">MDAnalysis.core.Selection.</tt><tt class="descname">PropertySelection</tt><big>(</big><em>prop</em>, <em>operator</em>, <em>value</em>, <em>abs=False</em><big>)</big><a class="headerlink" href="#MDAnalysis.core.Selection.PropertySelection" title="Permalink to this definition">¶</a></dt>
<dd><p>Some of the possible properties:
x, y, z, radius, mass,</p>
</dd></dl>

<dl class="class">
<dt id="MDAnalysis.core.Selection.ProteinSelection">
<em class="property">class </em><tt class="descclassname">MDAnalysis.core.Selection.</tt><tt class="descname">ProteinSelection</tt><a class="headerlink" href="#MDAnalysis.core.Selection.ProteinSelection" title="Permalink to this definition">¶</a></dt>
<dd><p>A protein selection consists of all residues with  recognized residue names.</p>
<p>Recognized residue names in <a class="reference internal" href="#MDAnalysis.core.Selection.ProteinSelection.prot_res" title="MDAnalysis.core.Selection.ProteinSelection.prot_res"><tt class="xref py py-attr docutils literal"><span class="pre">ProteinSelection.prot_res</span></tt></a>.</p>
<blockquote>
<div><ul>
<li><dl class="first docutils">
<dt>from the CHARMM force field::</dt>
<dd><p class="first last">awk &#8216;/RESI/ {printf &#8220;&#8217;&#8221;&#8217;&#8221;%s&#8221;&#8217;&#8221;&#8217;,&#8221;,$2 }&#8217; top_all27_prot_lipid.rtf</p>
</dd>
</dl>
</li>
<li><p class="first">manually added special CHARMM, OPLS/AA and Amber residue names.</p>
</li>
<li><p class="first">still missing: Amber N- and C-terminal residue names</p>
</li>
</ul>
</div></blockquote>
<dl class="attribute">
<dt id="MDAnalysis.core.Selection.ProteinSelection.prot_res">
<tt class="descname">prot_res</tt><a class="headerlink" href="#MDAnalysis.core.Selection.ProteinSelection.prot_res" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary of recognized residue names (3- or 4-letter).</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="MDAnalysis.core.Selection.SelectionParser">
<em class="property">class </em><tt class="descclassname">MDAnalysis.core.Selection.</tt><tt class="descname">SelectionParser</tt><a class="headerlink" href="#MDAnalysis.core.Selection.SelectionParser" title="Permalink to this definition">¶</a></dt>
<dd><p>A small parser for selection expressions.  Demonstration of
recursive descent parsing using Precedence climbing (see
<a class="reference external" href="http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm">http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm</a>).  Transforms
expressions into nested Selection tree.</p>
<p>For reference, the grammar that we parse is</p>
<div class="highlight-python"><pre>E(xpression)--&gt; Exp(0)
Exp(p) --&gt;      P {B Exp(q)}
P --&gt;           U Exp(q) | "(" E ")" | v
B(inary) --&gt;    "and" | "or"
U(nary) --&gt;     "not"
T(erms) --&gt;     segid [value]
                | resname [value]
                | resid [value]
                | name [value]
                | type [value]</pre>
</div>
</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="Timeseries.html" title="7.4. Compute observable timeseries from trajectories — MDAnalysis.core.Timeseries"
             >next</a> |</li>
        <li class="right" >
          <a href="AtomGroup.html" title="7.2. Fundamental building blocks — MDAnalysis.core.AtomGroup"
             >previous</a> |</li>
        <li><a href="../../index.html">MDAnalysis v0.7.5-devel documentation</a> &raquo;</li>
          <li><a href="../core_modules.html" >7. Core modules</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2005-2011, Naveen Michaud-Agrawal, Elizabeth J. Denning, Joshua Adelman,
    Christian Beckstein (logo), David Caplan, Jan Domański, Philip Fowler,
    Joseph Goose, Benjamin Hall, Danny Parton, Tyler Reddy, Paul Rigor,
    and Oliver Beckstein.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
  </body>
</html>